//---------------------------------------------------------------
//
//				Supper AB530x
//

#ifndef _PORT_TIMER_EX_H_
#define _PORT_TIMER_EX_H_



typedef enum {
	TIMER0,
	TIMER1,
	TIMER2,
	TIMER3,
	TIMER4,
	TIMER5,
}timer_module;


typedef struct {
	volatile unsigned long* TMRxCON;
	volatile unsigned long* TMRxCNT;
	volatile unsigned long* TMRxPR;
} timer_config_strc;

//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
//  Program code example
/*
	AT(.com_text.debug)
	const char dubeg_str1[] = "ISR1\r\n";
	AT(.com_text.timer)
	void isr_test1(void)
	{
		printf(dubeg_str1);
	}


	hw_timer_isr_setup(TIMER1, 500000, isr_test1);
	hw_timer_isr_stop(TIMER1);
*/



//-------------------------------------------------------------------------------------------------------
//
//
/*
timer 使用情况
timer0 : 系统时钟使用
timer1:  (可选)  ledseg_ajust.  7脚屏的时候使用(亮度均匀调节).  timer1_irq_init 
timer2:  (可选)    注意timer2和timer4/5用同一个中断向量入口, 需要timer2及tws时的话, 在tws_timer_isr查timer2的pending.  不要重新注册timer2, 会覆盖掉以前的timer4/5中断向量. 
timer3:  (可选)    软件红外解码使用...
timer4/timer5 : tws使用用了. 
*/
s8 hw_timer_isr_setup(timer_module timer_id, u32 period_us, void(* timer_isr_function)(void));
s8 hw_timer_isr_stop(timer_module timer_id);


#endif
